<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<%
	response.setHeader("Pragma", "No-Cache");
	response.setHeader("Cache-Control", "No-Cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>安徽省科技管理信息系统</title>
<link href="${res_app}/css/css.css" rel="stylesheet" type="text/css" />
<!-- 普通下拉框控件 -->
<script type="text/javascript" src="${res}/js/commons/irisSelect.js"></script>
<script type="text/javascript" src="${res}/js/jquery/jquery.js"></script>
<script type="text/javascript">
var ctx = "${ctx}";
var res = "${res}";
var res_app = "${res_app}";
</script>
<script type="text/javascript" src="${res_app}/js/app/public.js"></script>
<script type=text/javascript>	
	$(document).ready(function(){
		var selectedCode = $("#selectedCode").val();
		$("#officeList").find("option").each(function(){
			if(this.value == selectedCode) this.selected = true;
		});
	});
	
	function ContentDownDesc(template)
	{
		window.open('${res_app}/template/content/'+encodeURIComponent(template),'','resizable=yes,height=700,width=1000,scrollbars=yes,status=yes')
		return false;
	} 
	
	/**
	 * 下拉框操作
	 */
	function getNoticeByCode(objId){	
		var obj=$("#"+objId);
		var code = $("#"+objId).find("option:selected").val();
		window.location.href = ctx+"/notice/noticeList?code="+encodeURIComponent(code);
	}
 </script>
</head>
	<body>
		<div id="Hheader">
		   <div class="Hlogo"><a href="#"><img src="${res_app}/images/wuxi/logo.gif" alt="安徽省科技管理信息系统"  /></a></div>
		   <div class="Htop_nav">
			    <p class="gre_ys"><a href="/egrantweb/index" class="green0" >返回首页</a>| <a href="#" onclick="ShowFAQ();">常见问题</a> | <a href="#" onclick="showContact();">咨询服务</a></p>
			    <p class="orange14">技术支持：<strong>0551-62654951</strong></p>
		   </div>
		   <div class="clear"></div>
		</div>
		<div class="hn_top_nav1"> </div>
		<div class="hn_top_nav" style="text-align: left;">全部公告</div>
		<table width="980px" border="0" align="center" cellpadding="0" style="clear:both"
			cellspacing="0" bgcolor="#FFFFFF">
			<tr>
				<td>					
					<table width="980px" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td height="14"></td>
						</tr>
						<tr>
							<td height="14">
								<img src="${res_app}/images/index/news_title.gif" />								
							</td>
						</tr>
						<tr>
							<td height="14">
								<div style="text-align: right;padding-right:7%;">
									管理部门：
									<input type="hidden" id="selectedCode" value="<iris:des3 code='${code}'/>"/>
									<select id="officeList" onchange="getNoticeByCode(this.id)">
										<c:forEach items="${officeList}" var="ol">
											<option value="<iris:des3 code='${ol.ID}'/>">${ol.NAME}</option>
										</c:forEach>
									</select>
								</div>								
							</td>
						</tr>
						<tr>
							<td height="14"></td>
						</tr>
					</table>
					<table width="980px" border="0" align="center" cellpadding="0"
						cellspacing="0">         
						<tr>
							<td align="center">  
								<table width="92%" border="0" cellspacing="0" cellpadding="0">
							       <c:forEach items="${noticeList}" var="vo">
							        <tr>
							            <td width="16">
										-
									    </td>
									    <td height="26" align="left">
									        <c:set var="notice_type">${vo.NOTICE_TYPE}</c:set>
									        <c:if test="${notice_type==1}">
									            <c:set var="url">${vo.NOTICE_URL}</c:set>
									        </c:if>
									        <c:if test="${notice_type==2}">
									            <c:set var="file_code">${vo.FILE_CODE}</c:set>
									            <c:set var="url">${ctx}/file/ajax-filedownload?fileCode=${file_code}</c:set>
									        </c:if>
									        <c:if test="${notice_type==3}">
									            <c:set var="key">${vo.NOTICE_ID}</c:set>
									            <c:set var="url">${ctx}/notice/view_notice_text?key=<iris:des3 code="${key}"/></c:set>
									        </c:if>
									        <c:set var="comDate" scope="request" value="${vo.NOTICE_DATE}"></c:set>                  
			                                <%
			                                   SimpleDateFormat format= new SimpleDateFormat("yyyy-MM-dd");
			                                   Date comDate = (Date)request.getAttribute("comDate");
			                                       //加7天（一个星期）
			                                   Calendar calendar = Calendar.getInstance();
			                                   calendar.setTime(comDate);
			                                   calendar.add(Calendar.DAY_OF_YEAR,7);                      
			                                   Date comDate2 = calendar.getTime();
			         
			                                   Date nowDate = format.parse(format.format(Calendar.getInstance().getTime()));
                                               boolean flag = nowDate.before(comDate2);
                                               String comDateStr = format.format(comDate);
                                            %>
                                            <c:set var="isnew"><%= flag %></c:set>   
                                            <c:set var="noticeDateStr" value="<%= comDateStr %>"></c:set>      
									        <a href="${url}" target="_blank"><font color="">[${vo.CNAME }]${vo.NOTICE_TITLE}</font><c:if test="${isnew == true}">(<font color="#ff0000">new</font>)</c:if></a>
									    </td>
									    <td width="100" align="left">
										    <span class="STYLE1">(${noticeDateStr})</span>
									    </td>
							        </tr>   
							      </c:forEach>
						            <tr>
							            <td align="center">&nbsp;</td>
						            </tr>
					           </table>
				           </td>
			           </tr>
		           </table>
		        </td>
		     </tr>
		</table>
		<!-- FOOTER START -->
		<div id="Hfooter" style="margin-top:20px;">
		  <p>技术支持：<a href="http://www.irissz.com/" target="_blank">爱瑞思软件（深圳）有限公司</a>
		  &nbsp;&nbsp;&nbsp;&nbsp;<a href="${res_app}/support-brower.html" target="_blank">浏览器支持</a> 
		</div>
		<!-- FOOTER END -->
	</body>
</html>